package exception;

public class TryCatchDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始执行：");
        try{
            String str = null;
            System.out.println(str.length());
            System.out.println(str.charAt(3));
            System.out.println(Integer.parseInt(str));
        }catch (NullPointerException | StringIndexOutOfBoundsException e){
            System.out.println("出现了异常！");
        }catch (Exception e){
            System.out.println("出现了异常！");
        }
        System.out.println("程序执行完毕！");
    }
}
